package com.example.demo.services.impl;

import com.example.demo.dao.SHRRepository;
import com.example.demo.entity.SHR;
import com.example.demo.services.SHRService;
import com.example.demo.services.SHRService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SHRServiceImpl implements SHRService {

    @Autowired
    private SHRRepository shrRepository;

    /**
     * @Author: Ding XiJie
     * @Description: 添加收货人
     */
    @Override
    public SHR save(SHR shr) {
        shr = shrRepository.save(shr);
        return shr;
    }

    /**
     * @Author: Ding XiJie
     * @Description: 修改收货人
     */
    @Override
    public SHR update(SHR shr) {
        return shrRepository.save(shr);
    }

    /**
     * @Author: Ding XiJie
     * @Description: 删除收货人
     */
    @Override
    public void delete(int id) {
        shrRepository.deleteById(id);
    }
}
